# import datetime
# # 1.日期计算器
# date1 = datetime.datetime(year=2003, month=1, day=13)
# date2 = datetime.datetime(2023, 11, 19)
#
# print(date2 - date1)
# from datetime import datetime
# date1 = datetime(year=2003, month=1, day=13)
# date2 = datetime(2023, 11, 19)
#
# print(date2 - date1)
# import datetime as dt
# date1 = dt.datetime(year=2003, month=1, day=13)
# date2 = dt.datetime(2023, 11, 19)
#
# print(date2 - date1)
#------------------------------------------------------
# # 2.单词逆序
def reverse_word(s: str):
    tokens = s.split(" ")
    tokens.reverse()
    return " ".join(tokens)

# print(reverse_word("i m a student"))


#------------------------------------------------------
# # 2.旋转字符串
def rotate_word(s1: str, s2: str):
    if len(s1) != len(s2):
        return False
    if s2 in (s1 + s1):
        return True
    return False


# print(rotate_word("abcde", "cdeab"))
# print(rotate_word("abcde", "cdaeb"))


#------------------------------------------------------
# # 3.统计字符串前缀
def count_prefiex(words: list, s: str):
    count = 0
    for word in words:
        if s.startswith(word):
            count += 1
    return count

# print(count_prefiex(["a", "b", "c", "ab", "abc"], "abc"))
# print(count_prefiex(["a", "a"], "aa"))



